package config;

import java.io.InputStream;

public class Config {
	
	public static final String JDBC_URL = "JdbcUrl";
	
	public static final String JDBC_USER = "JdbcUser";
	
	public static final String JDBC_PWD = "JdbcPwd";

	private static final String CONFIG_FILE = "config.properties";
	
	private static Config config = new Config(CONFIG_FILE);
	
	private java.util.Properties properties = new java.util.Properties();	
	
	private Config(String fileName) {
		InputStream configFile = Config.class.getClassLoader().getResourceAsStream(fileName);
		try {
			properties.load(configFile);
		} catch (Exception ex) {
            ex.printStackTrace();
		}
	}
	
	public static String getProperty(String name) {
		return config.properties.getProperty(name);
	}
	
	public static void main(String[] args) {
		System.out.println(Config.getProperty(Config.JDBC_URL));
	}

}
